package com.roger.homecenterscreen.data.model

import com.google.gson.annotations.SerializedName

data class ApiResponse(
    @SerializedName("success")
    val success: Boolean,
    @SerializedName("data")
    val data: ContentData?,
    @SerializedName("error")
    val error: ApiError?
)

data class ContentData(
    @SerializedName("backgroundImage")
    val backgroundImage: BackgroundImage,
    @SerializedName("content")
    val content: Content,
    @SerializedName("refreshInterval")
    val refreshInterval: Long = 300000L
)

data class BackgroundImage(
    @SerializedName("url")
    val url: String,
    @SerializedName("opacity")
    val opacity: Float = 0.8f
)

data class Content(
    @SerializedName("type")
    val type: String, // "list" | "text" | "mixed"
    @SerializedName("items")
    val items: List<ContentItem>
)

data class ContentItem(
    @SerializedName("type")
    val type: String, // "list" | "text"
    @SerializedName("title")
    val title: String,
    @SerializedName("content")
    val content: String? = null, // 仅text类型
    @SerializedName("items")
    val items: List<ListItem>? = null // 仅list类型
)

data class ListItem(
    @SerializedName("id")
    val id: String,
    @SerializedName("text")
    val text: String,
    @SerializedName("completed")
    val completed: Boolean = false,
    @SerializedName("priority")
    val priority: String = "low" // "high" | "medium" | "low"
)

data class ApiError(
    @SerializedName("code")
    val code: String,
    @SerializedName("message")
    val message: String
) 